﻿using System;
using System.Linq;
using System.Web.Mvc;
using Tmkilla.Localizr.Web.Base.Mvc.Models.ViewModels;

namespace Web.FrontEnd.Controllers.Installer
{
    public class InstallerController : Tmkilla.Localizr.Web.Base.Mvc.Controllers.ControllerBase
    {
        #region MVC Actions

        /// <summary>
        /// GET: /Installer/Start
        /// </summary>
        /// <returns>View "/Installer/Start"</returns>
        /// <author>David Rietz (tmkilla)</author>
        /// <created>2012-10-12 23:30</created>
        /// <changed></changed>
        public ActionResult Start()
        {
            PrepareCommonViewData();
            ViewBag.CurrentPageId = "LOCALIZR_INSTALLER_START";

            return View("Start");
        }

        /// <summary>
        /// GET: /Installer/Database
        /// </summary>
        /// <returns>View "/Installer/Database"</returns>
        /// <author>David Rietz (tmkilla)</author>
        /// <created>2012-11-03 23:59</created>
        /// <changed></changed>
        public ActionResult Database()
        {
            PrepareCommonViewData();
            ViewBag.CurrentPageId = "LOCALIZR_INSTALLER_DATABASE";

            return View("Database");
        }

        /// <summary>
        /// POST: /Installer/PerformDatabaseSetup
        /// Performs the database setup.
        /// </summary>
        /// <returns>EmptyResult</returns>
        /// <author>David Rietz (tmkilla)</author>
        /// <created>2012-11-21 16:48</created>
        /// <changed></changed>
        [AcceptVerbs(HttpVerbs.Post)]
        public ActionResult PerformDatabaseSetup()
        {
            var result = new JsonResponse
            {
            	HasError = false,
                Message = "Das ist ein Test."
            };

            return PartialView("Async/JsonResponse", result);
        }

        #endregion
    }
}
